//index.js
//获取应用实例
var app = getApp()
Page({
    data: {
        hidden: true,
        count: '1',
        imgUrls: [
            '../../images/su.jpg',
            '../../images/yan.jpg',
            '../../images/jiangyou.jpg'
        ],
        indicatorDots: true,
        autoplay: false,
        interval: 5000,
        duration: 1000,
        goodsList: [
            {
                id: 132,
                imgUrl: '../../images/xiaolongxia.jpg',
                title: '半价小龙虾',
                oldPrice: 88.8,
                newPrice: 68.8
            },
            {
                id: 122,
                imgUrl: '../../images/gouliang.jpg',
                title: '狗粮优惠大放送',
                oldPrice: 199,
                newPrice: 108
            },
            {
                id: 302,
                imgUrl: '../../images/duanxiu.jpg',
                title: '女士短袖',
                oldPrice: 19.9,
                newPrice: 8.8
            },
            {
                id: 498,
                imgUrl: 'https://img.alicdn.com/bao/uploaded/i1/858568558/TB2JQ.tbnAKL1JjSZFCXXXFspXa_!!858568558.jpg_b.jpg',
                title: '特仑苏整箱装特仑苏整箱装',
                oldPrice: 56,
                newPrice: 40
            },
            {
                id: 588,
                imgUrl: 'https://img.alicdn.com/bao/uploaded/i4/725677994/TB1nWgGaHsTMeJjy1zeXXcOCVXa_!!2-item_pic.png_b.jpg',
                title: '卫龙辣条100g装',
                oldPrice: 4,
                newPrice: 3
            },
            {

                id: 600,
                imgUrl: 'https://img.alicdn.com/bao/uploaded/i3/494858290/TB1.jYocxHI8KJjy1zbXXaxdpXa_!!0-item_pic.jpg_b.jpg',
                title: '洁丽雅纯棉毛巾',
                oldPrice: 9.9,
                newPrice: 8.8
            }
        ]
    },
    onLoad: function () {
        var that = this
        //调用应用实例的方法获取全局数据
        app.getUserInfo(function (userInfo) {
            //更新数据
            that.setData({
                userInfo: userInfo
            })
        })
        wx.getSystemInfo({
            success: function (res) {
                that.setData({
                    height: res.windowHeight + 'px'
                });
            }
        })
    },
    search: function (e) {
        wx.navigateTo({
            url: '/pages/search/search'
        })
    }
})